from typing import List, Literal


pi = r'\pi'
e = 'e'


class SYMBOL:
    CDOTS = r'\cdots'
    VDOTS = r'\vdots'
    DDOTS = r'\ddots'


def matrix(mat: List[list], braket_type: Literal['p', 'b']='p') -> str:
    """mat to latex
    
    Args:
        mat: matrix data
        braket_type: `p` for parentheses, 'b' for brackets
    """
    smatrix = braket_type + 'matrix'
    s = r'\begin{' + smatrix + '} '
    s += r' \\ '.join([' & '.join(map(str, v)) for v in mat])
    s += r' \end{' + smatrix + '}'
    return s


def fraction(numerator, denominator) -> str:
    return r'\frac{' + str(numerator) + '}{' + str(denominator) + '}'